Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tests & refactor tx crate #3835

Closed
wants to merge 9 commits into from
Closed

add tests & refactor tx crate #3835

wants to merge 9 commits into from

Conversation

tzemanovic
Copy link
Member

@tzemanovic tzemanovic commented Sep 20, 2024

Describe your changes

related to #1497

closes #3200

Checklist before merging

  • If this PR has some consensus breaking changes, I added the corresponding breaking:: labels
    • This will require 2 reviewers to approve the changes
  • If this PR requires changes to the docs or specs, a corresponding PR is opened in the namada-docs repo
    • Relevant PR if applies:
  • If this PR affects services such as namada-indexer or namada-masp-indexer, a corresponding PR is opened in that repo
    • Relevant PR if applies:

Copy link

codecov bot commented Sep 20, 2024

Codecov Report

Attention: Patch coverage is 80.30994% with 216 lines in your changes missing coverage. Please review.

Project coverage is 73.00%. Comparing base (be38d4c) to head (59f89bf).
Report is 54 commits behind head on main.

Files with missing lines Patch % Lines
crates/tx/src/section.rs 69.00% 137 Missing ⚠️
crates/sdk/src/signing.rs 4.16% 23 Missing ⚠️
crates/tx/src/sign.rs 80.99% 23 Missing ⚠️
crates/tx/src/types.rs 97.27% 12 Missing ⚠️
crates/node/src/shell/finalize_block.rs 37.50% 5 Missing ⚠️
crates/sdk/src/masp.rs 0.00% 3 Missing ⚠️
crates/vote_ext/src/lib.rs 66.66% 3 Missing ⚠️
crates/governance/src/vp/mod.rs 50.00% 2 Missing ⚠️
crates/node/src/shell/mod.rs 33.33% 2 Missing ⚠️
crates/trans_token/src/vp.rs 50.00% 2 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3835      +/-   ##
==========================================
+ Coverage   72.82%   73.00%   +0.18%     
==========================================
  Files         338      339       +1     
  Lines      104220   104637     +417     
==========================================
+ Hits        75897    76393     +496     
+ Misses      28323    28244      -79     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tzemanovic tzemanovic marked this pull request as ready for review September 23, 2024 15:11
}

// Set inner tx data
let data_bytes = "bingbong".as_bytes();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤣

#[derive(Debug, Clone)]
pub enum InnerTxRef<'a> {
/// A direct ref to tx commitments
Commitment(&'a TxCommitments),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this was an owned value instead of a ref we could use InnerTx inside both BatchedTx and BatchedTxRef in place of TxCommitments but this would imply many more changes and those two struct are only used within the protocol, don't know if you have a strong opinion on this

@grarco
Copy link
Contributor

grarco commented Sep 24, 2024

Also there are a few functions in tx/src/data/mod.rs that take as an input a reference to the commitments using Either

commitments: Either<&Hash, &TxCommitments>,

I think we can use the new InnerTxRef now

tzemanovic added a commit that referenced this pull request Oct 2, 2024
tzemanovic added a commit that referenced this pull request Oct 2, 2024
@tzemanovic
Copy link
Member Author

closing in favor of #3868

@tzemanovic tzemanovic closed this Oct 2, 2024
tzemanovic added a commit that referenced this pull request Oct 2, 2024
mergify bot pushed a commit that referenced this pull request Oct 2, 2024
(cherry picked from commit 02eca6e)
tzemanovic added a commit that referenced this pull request Oct 3, 2024
* mergify/bp/0.44.0/pr-3868:
  changelog: add #3835
  tx: test tx sections api
  tx: improve the serialization api
  test/tx: add more unit tests
  tx: split out tx sections into dedicated mod
  tx: move signing related code into sign mod
  tx: rm unsued `SignedTxData`
  refactor and test signature index
  tx/types: rm unused code
  test/e2e: no dbg logs in shielded sync
tzemanovic added a commit that referenced this pull request Oct 11, 2024
* 0.44.0:
  Namada 0.44.1
  Removes old reference to encrypted txs
  test/e2e/ibc: try to kill gaiad before running it
  Fixes broken assertions in integration tests
  Update crates/sdk/src/queries/vp/pos.rs
  small fix from comments
  changelog: add #3899
  fix up liveness queries
  Add new rpc query function to check validators' liveness(uptime) in this epoch
  test/e2e: try to forward Ctrl+C to the bg session
  Changelog for #3860
  feat: serde rename batch index into masp tx index
  Tries to drop bg process in tests
  mergify: unquote base branch name
  Changelog #3882
  Extends batch sections test to check duplicate sections
  Custom `PartialEq` impl for `SigningTxData`
  Fixes cmt reference in `add_inner_tx`
  Avoids duplicated sections when contructing a batch
  ci/mergify: unquote base name
  Increases timeout on epoch sleep
  Improves epoch sleeping in ibc tests and renames token variable
  Changelog #3866
  Sped up ibc token test
  Fixes ibc gas payment test
  Fixes typos and updates docstring
  e2e test for ibc token gas payment
  goveranance: let validator vote even if it doesn't have a self-bond
  changelog: add #3835
  tx: test tx sections api
  tx: improve the serialization api
  test/tx: add more unit tests
  tx: split out tx sections into dedicated mod
  tx: move signing related code into sign mod
  tx: rm unsued `SignedTxData`
  refactor and test signature index
  tx/types: rm unused code
  test/e2e: no dbg logs in shielded sync
  ci/mergify: add merge rule for backport to 0.44
  mergify: add backport strategy
  Changelog #3857
  Removes unused `Success` event
  Adds test for identical events in batch
  Adds batch events tests
  Removes eprintln from prepare proposal unit tests
  Adds tests for whitelisted tokens gas payment
  update hermes
  test/e2e: increase hermes timeout
  README: add notes about hermes
  update hermes
  ci: run checks on release branches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor inner Txs interface
2 participants